<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var i,j,k,sum;
        k = 0;
        for(i=1;i<=20;i++){
            sum = 1;
            for(j=1;j<=i;j++){
                sum = sum*j;
            }
            k = k+sum;
        }
        document.write(k);
    </script>
</body>
</html>